package 笔试.美团;

import java.util.Arrays;
import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        //T组
        int T = in.nextInt();
        for (int i = 0; i < T; i++) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] nums = new int[n];
            for (int j = 0; j < n; j++) {
                nums[j] = in.nextInt();
            }
            Arrays.sort(nums);

            if(nums[k-1]>=n || (k<n-1 && nums[k]==nums[k-1])){
                System.out.println("NO");

            }else{
                System.out.println("YES");
                System.out.println(nums[k-1]+1);
            }
        }


       /* int T = in.nextInt();
        for (int i = 0; i < T; i++) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] nums = new int[n];
            for (int j = 0; j < n; j++) {
                nums[j] = in.nextInt();
            }
            Arrays.sort(nums);
            int x = nums[k-1]+1;
            if(x>=1 && x<=n && x<=nums[k]){
                System.out.println("YES");
                System.out.println(x);
            }else{
                System.out.println("NO");
            }



        }*/



    }
}
